import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        while(true) {
            Scanner scanner = new Scanner(System.in);
            long m = scanner.nextLong();
            //long n = scanner.nextLong();
            long n = 2;
            System.out.println(Long.toBinaryString(m));
            StringBuffer ret = new StringBuffer("");
            long k = 0;
            while (m > 0) {
                k = m % n;
                //System.out.println(k);
                m /= n;
                if (k <= 9) {
                    ret.append((char) ('0' + k));
                } else {
                    ret.append((char) ('A' + k - 10));
                }
            }
            ret.reverse();
            while(ret.length()>0&&ret.charAt(0) == '0') {
                ret.deleteCharAt(0);
            }
            if(ret.length() == 0) ret.append("0");
            System.out.println(ret);
        }

    }
}

class Main1 {
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt(); //A-B 1
        int b = scanner.nextInt(); //B-C -2
        int c = scanner.nextInt(); //A+B 3
        int d = scanner.nextInt(); //B+C 4 B+C = d  C=d-B=d-(b+d)/2
        int A = (a + c) / 2;
        int B = (b + d) / 2;
        int C = d - (b + d) / 2;
        if (A - B != a || B - C != b || A + B != c || B + C != d) {
            System.out.println("No");
        } else {
            System.out.println(A + " " + B + " " + C);
        }
    }
}